import css from '../test/test.module.css'
import React from 'react';
import Viewone from './cmn/viewone/index.js'

class test extends React.Component{
  constructor(){
    super()
    this.state ={
      viewlist:['one','two','three'],
      jj:'jj'
    }
  }
  changgeview=()=>{
    this.setState({
      viewlist:['one','two','three','four']
    })
  }
  render(){
    return (
      <div className='testtwo'>
        <p>3333333333</p>
        {/* <p  style={{lineHeight:'32px'}} onClick={this.changgeview()}>事件后面加括号时，事件会自动执行，点击没有反应</p> */}
        <p  style={{lineHeight:'32px'}} onClick={this.changgeview}>事件后面不加括号，函数this获取，可以用箭头函数，就可以获取this</p>
        <Viewone viewlist={this.state.viewlist}></Viewone>
      </div>
    )
  }

}

export default test;